package com.chinasi.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.caland.framework.core.page.Pager;
import com.chinasi.dao.ExpertBasicDao;
import com.chinasi.model.ExpertBasic;
import com.chinasi.service.ExpertBasicService;

@Service
public class ExpertBasicServiceImpl implements ExpertBasicService {

	/**
	 * ExpertBasicDAO
	 */
	@Autowired
	private ExpertBasicDao ExpertBasicDao;

	@Override
	public Pager findPageCondition(ExpertBasic searchBean, int currentPage) {
		Pager pager = new Pager(ExpertBasicDao.getTotalCount(searchBean),currentPage);
		pager.setData(ExpertBasicDao.findByCondition(searchBean, pager.getStartRow(), pager.getPageSize()));
		return pager;
	}

	@Override
	public ExpertBasic findById(String id) {
		return ExpertBasicDao.findByPK(id, ExpertBasic.class);
	}

	@Override
	public int findTotalCount() {
		return ExpertBasicDao.getTotalCount(new ExpertBasic());
	}
	
}
